<?php echo Modules::run('common/header') ?>

      <!-- Begin page content -->
      <div class="container content-body">
      	<div class="page-header" style="position:relative;">
  			<h1>Product</h1>  
        <a class="btn btn-info" href="<?php echo site_url('manager/form_product') ?>" style="position:absolute; right:0;top:0; margin:5px 0;">
          <i class="icon-plus"></i> Add Product</a>			
		</div>

		<div id="message"></div>

      	<table class="table table-striped ">
              <thead>
                <tr style="background:#E2E2E2;">
                	<th style="width: 15px;"><input type="checkbox"></th>
                  	<th>No</th>
                  	<th>Product Image</th>
                  	<th>Product Name</th>
                  	<th>Price</th>
                  	<th>Quantity</th>
                  	<th>Status</th>
                  	<th>Action</th>	
                </tr>
              </thead>
              <tbody>                

                	<?php 
                  $no = 1; 
                  if ($this->uri->segment(3) != '')
                    $no = $this->uri->segment(3) + 1;
                  ?>

                	<?php foreach ($products as $key => $value) : ?>
        			
        			<tr>
                	<td><input type="checkbox"></td>
                	<td> <?php echo $no; ?></td>
                	<td> <?php echo img('data/thumb/'.$value->image_file);?> </td>
                	<td> <?php echo $value->product_name;?> </td>
                	<td> <?php echo number_format($value->price);?> </td>
                	<td> <?php echo $value->quantity;?> </td>
                	<td> <?php echo $value->status == 1 ? "Enable":"<span style='color:#E91510'>Disable</span>";?> </td>
                	<td> <a href="<?php echo site_url('manager/form_product/'.$value->product_id);?>">Edit</a> | <a href="<?php echo site_url('manager/delete_product/'.$value->product_id);?>" onclick="return confirmDelete();">Delete</a></td>

                	<?php $no++; ?>
                	</tr>

        			<?php endforeach; ?>                 
                
              </tbody>
            </table>

            <center>
              <?php echo $pagination; ?>
            </center>

      </div>

<?php echo Modules::run('common/footer') ?>